package com.sugon.modules.analyse.model.chart;

import cn.hutool.core.collection.CollectionUtil;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @description: 折线图 chart数据MODEL
 * @author: YuXD
 * @create: 2023-03-01
 **/
@NoArgsConstructor
@Data
public class LineChartDataModel implements Serializable {

    /**
     * 标题
     */
    private String title;

    /**
     * echarts legend部分的数据
     */
    private List<String> legendData;

    /**
     * 横坐标显示内容
     */
    private List<String> xAxisData;

    /**
     * series项
     */
    private List<EchartsSeriesItemModel> series;

    public LineChartDataModel(String title) {
        this.title = title;
        series = CollectionUtil.newArrayList();
        legendData = CollectionUtil.newArrayList();
    }

    public boolean addSeriesData(EchartsSeriesItemModel seriesData) {
        return this.series.add(seriesData);
    }

}
